package 尚硅谷.juc.test7;

import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;

public class Test7 {


    public static void main(String[] args) {

        Set<String> list= new CopyOnWriteArraySet<>();
        for (int i=0;i<300;i++){
            new Thread(()->{
                list.add(UUID.randomUUID().toString().substring(0,8));
                System.out.println(list);
            }).start();
        }
    }
}
